package www.domain;

import org.apache.ibatis.jdbc.SQL;
import org.springframework.stereotype.Component;

import java.util.Map;

@Component
public class VehicleInfoSql {

    public String querySpuCodeByEnv(String env) {
        String condition = "env=" + "‘" + env + "‘";
        return new SQL()
                .SELECT("spu_code")
                .FROM("vehicle_info")
                .WHERE(condition)
                .toString();
    }

    public String querySpuCodeByEnv2(String env) {
        return new SQL() {
            {
                SELECT("spu_code");
                FROM("vehicle_info");
                String condition = "env='" + env + "'";
                WHERE(condition); // 添加WHERE条件
            }
        }.toString();
    }
}
